home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
database
/
do1beta
/
private.do
< prev
next >
Wrap
Text File
|
1991-07-23
|
498b
|
23 lines
/*
demo of a private method for a class
private methods are only callable from within a method for a class
*/
inherit(Nil,Temp,[]);
private Temp::testPrivate(self)
{
? "within testPrivate";
}
method Temp::test(self)
{
? "enter Temp::test";
testPrivate(self);
? "exit Temp::test";
}
v = new(Temp);
test(v); % this will work, Temp::testPrivate will be called by Temp::test
? "the next statement will cause an error !...\n";
testPrivate(v); % this will cause an error !